projects
/
emacs.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c86960f
)
* minibuf.c (read_minibuf_noninteractive): Don't leak memory
author
Paul Eggert
<eggert@cs.ucla.edu>
Fri, 29 Jul 2011 01:01:17 +0000
(18:01 -0700)
committer
Paul Eggert
<eggert@cs.ucla.edu>
Fri, 29 Jul 2011 01:01:17 +0000
(18:01 -0700)
on memory overflow.
src/ChangeLog
patch
|
blob
|
history
src/minibuf.c
patch
|
blob
|
history
diff --git
a/src/ChangeLog
b/src/ChangeLog
index 435d883e14f9e2b7268b4ac1c420ad0b21e9bcfe..4e10537edc8e43e449bcd4553ba39b7d87dbf744 100644
(file)
--- a/
src/ChangeLog
+++ b/
src/ChangeLog
@@
-1,5
+1,8
@@
2011-07-29 Paul Eggert <eggert@cs.ucla.edu>
+ * minibuf.c (read_minibuf_noninteractive): Don't leak memory
+ on memory overflow.
+
* macros.c: Integer and memory overflow fixes.
(Fstart_kbd_macro): Don't update size until alloc done.
(store_kbd_macro_char): Reorder multiplicands to avoid overflow.
diff --git
a/src/minibuf.c
b/src/minibuf.c
index eb564a10ec6f8099590ec36ec0e6d7823e0a0500..30082af90376d4c1e7f36ace4d075a1bd3ef45e5 100644
(file)
--- a/
src/minibuf.c
+++ b/
src/minibuf.c
@@
-261,7
+261,10
@@
read_minibuf_noninteractive (Lisp_Object map, Lisp_Object initial,
if (len == size)
{
if (STRING_BYTES_BOUND / 2 < size)
- memory_full (SIZE_MAX);
+ {
+ xfree (line);
+ memory_full (SIZE_MAX);
+ }
size *= 2;
line = (char *) xrealloc (line, size);
}